//
//@File    :	practice_3.3.cpp
//@Time    :	2021/12/28 13:27:30
//@Auther  :	Sun Sheng
//@Contact :	970340843@qq.com
//@Desc    :	practice3.3
//

//编写一个程序,要求用户以度,分,秒的方式输入一个纬度
//然后以度为单位显示该维度.一度为60分,1分为60秒,请以符号常量的方式表示这些值
//对于每个输入值,应使用一个独立变量存储

#include <iostream>

int main()
{
    using namespace std;
    const double seconds_per_minute=60;
    const double minute_per_degree=60;

    int degree=0;
    int minute=0;
    int second=0;
    int out_degree=0;
    cout<<"Enter a latitude in degrees,minutes,and seconds: "<<endl;
    cout<<"First,enter the degree:  ";
    cin>>degree;
    cout<<endl;
    cout<<"Next,enter the minutes of arc: ";
    cin>>minute;
    cout<<endl;
    cout<<"Finally,enter the seconds of arc:";
    cin>>second;
    cout<<endl;
    out_degree=second/seconds_per_minute/minute_per_degree+minute/minute_per_degree+degree;
    cout<<degree<<" degrees,"<<minute<<" minutes,"<<second<<" seconds = "<<out_degree<<" degrees.";
    system("pause");
    return 0;
}